Skip to content

Implement session persistence and chat history retrieval#9

Merged
codebyNorthsteep merged 1 commit into
mainfrom
enhancement/frontens-add-inmemory-for-uuid
May 8, 2026
Merged

Implement session persistence and chat history retrieval#9
codebyNorthsteep merged 1 commit into
mainfrom
enhancement/frontens-add-inmemory-for-uuid

Conversation

@codebyNorthsteep

Copy link
Copy Markdown
Owner

This pull request introduces improvements to the chat functionality, focusing on better user experience and enhanced message tracking. The main changes include persisting chat sessions across page reloads, associating sender names with chat messages, and restoring chat history when the page loads.

Chat session persistence and restoration:

  • Added a getSessionId function in app.js to store and reuse a unique session ID in localStorage, ensuring chat sessions persist across page reloads. The chatState object now initializes sessionId using this function.
  • Implemented a DOMContentLoaded event listener in app.js that fetches and restores the chat history for the current session from the backend when the page loads, displaying previous messages in the chat window.

Message structure and sender tracking:

  • Updated the ChatMessage class to include a senderName field and adjusted its constructor accordingly in ChatMessage.java.
  • Modified ChatService.java to include the sender's name when adding messages to the chat session: "You" for user messages and the personality name for assistant messages.- Refactored ChatMessage class to include senderName.
  • Updated ChatService to store sender names when adding user and assistant messages.
  • Added logic to persist and retrieve sessions via sessionId in the frontend.
  • Prefetched session chat history on page load and rendered stored messages in the chat window.

- Refactored `ChatMessage` class to include `senderName`.
- Updated `ChatService` to store sender names when adding user and assistant messages.
- Added logic to persist and retrieve sessions via `sessionId` in the frontend.
- Prefetched session chat history on page load and rendered stored messages in the chat window.
@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@codebyNorthsteep has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 44 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 26883ba8-70aa-40a0-8069-638930b3a669

📥 Commits

Reviewing files that changed from the base of the PR and between 20fbef2 and 049c48b.

📒 Files selected for processing (3)
  • src/main/java/org/example/projectbifrost/domain/ChatMessage.java
  • src/main/java/org/example/projectbifrost/service/ChatService.java
  • src/main/resources/static/app.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch enhancement/frontens-add-inmemory-for-uuid

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codebyNorthsteep

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@codebyNorthsteep
codebyNorthsteep merged commit d38b844 into main May 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant